<include file="public@header"/>
</head>
<style>
th,td{text-align: center;}
</style>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="javascript:;">所有审核—注册账号</a></li>
    </ul>
    <form class="js-ajax-form" action="" method="post">
        <div class="table-actions">
        </div>
        <table class="table table-hover table-bordered table-list">
            <thead>
            <tr>
                <th>ID</th>
                <th>用户名</th>
                <th>用户登录邮箱</th>
                <th>账号状态</th>
                <th>职位</th>
                <th>注册时间</th>
                <th>操作</th>
            </tr>
            </thead>
            <foreach name="user_res" item="res"> 
                <tr>
                    <td>{$res.id}</td>
                    <td><a>{$res.user_login}</a></td>
                    <td><a>{$res.user_email}</a></td>
                    <td><a>{$res.user_status}</a></td>
                    <td><a>{$res.authority}</a></td>
                    <td><a>{$res.create_time|date('Y-m-d H:i:s', time());}</a></td>
                    <td><button class="btn btn-success btn-sm" id="btn" type="button" onclick="vali_date('{$res.id}')" >通过验证</button>
                        <button class="btn btn-danger btn-sm" id="btn" type="button" onclick="dete('{$res.id}')">{:lang('DELETE')}</button></td>
                </tr>
            </foreach>
        </table>
        <div class="pagination">{$user_list}</div> 
    </form>
</div>
<script>
    function dete(id){
    var msg = "您真的确定要删除该账号注册吗？";  
            if (confirm(msg)==false){  
                return false;
            }
		$.ajax({
			type:"post",
			url:"{:url('admin/Examine/deteUser')}",
			data:{
				'id' : id,
			},
			dataType:"json",
			success:function(data){
        if(data == 1){
          alert("删除成功!!!");
          location.reload();
          return false;
        }else{
          alert("删除失败!!!");return false;
        }
        
		}
  	});	
};
    //通过验证
    function vali_date(id){
    var msg = "您真的同意该账号注册吗？";  
            if (confirm(msg)==false){  
                return false;
            }
		$.ajax({
			type:"post",
			url:"{:url('admin/Examine/dateVali')}",
			data:{
				'id' : id,
			},
			dataType:"json",
			success:function(data){
        if(data == 1){
          alert("验证成功,已允许账号注册!!!");
          location.reload();
          return false;
        }else{
          alert("验证失败!!!");return false;
        }
        
		}
  	});
    };      
</script>
</body>
</html>